//
//  WuKongBaseModule.m
//  WuKongBase
//
//  Created by tt on 2022/9/25.
//

#import "WuKongBaseModule.h"
#import "WuKongBase.h"
#import "WKLanguageVC.h"

@WKModule(WuKongBaseModule)
@implementation WuKongBaseModule

- (NSString *)moduleId {
    return @"WuKongBase";
}

- (void)moduleInit:(WKModuleContext *)context {
    NSLog(@"【WuKongContacts】模块初始化！");
    
    __weak typeof(self) weakSelf = self;
    
//    [self setMethod:@"me.lang" handler:<#(nonnull id)#> category:<#(NSString * _Nullable)#> sort:<#(int)#>]
    
//    [self setMethod:@"me.lang" handler:^id _Nullable(id  _Nonnull param) {
//            return [WKMeItem initWithTitle:LLangW(@"语言",weakSelf) icon:[weakSelf imageName:@"Me/Index/IconFavorite"] onClick:^{
//                 [[WKNavigationManager shared] pushViewController:[WKLanguageVC new] animated:YES];
//            }];
//        } category:WKPOINT_CATEGORY_ME sort:9000];
    
//    // 多语言
//    [self setMethod:@"me.lang" handler:^id _Nullable(id  _Nonnull param) {
//        BOOL supportDarkMode = NO;
//        if (@available(iOS 13.0, *)) {
//            supportDarkMode = YES;
//        }
//        NSString *darkDesc = LLang(@"打开");
//        if([WKApp shared].config.darkModeWithSystem) {
//            darkDesc = LLang(@"跟随系统");
//        }else {
//            darkDesc = WKApp.shared.config.style == WKSystemStyleDark?LLang(@"打开"):LLang(@"关闭");
//        }
//
//        return  @{
//                @"height":WKSectionHeight,
//            @"items":@[
//                    @{
//                        @"class":WKLabelItemModel.class,
//                        @"label":LLang(@"语言"),
//                        @"onClick":^{
//                            WKLanguageVC *vc = [WKLanguageVC new];
//                            [[WKNavigationManager shared] pushViewController:vc animated:YES];
//                        }
//                    },
//            ],
//        };
//    } category:WKPOINT_CATEGORY_ME sort:70000];
}

-(UIImage*) imageName:(NSString*)name {
    return [[WKApp shared] loadImage:name moduleID:@"WuKongBase"];
}

@end

